/-app
/-docs
/-docs/types
/-docs/types/text
CodeMirror-ext.css
api.ts
load.ts
api.ts
listSubmodules.ts
load.ts
DocHost.ts
/-files
/-imports ...
/-imports/codemirror ...
codemirror.css
codemirror.js
/-imports/jquery
/-imports/knockout
/-persistence
/-typings
errors.js
functions.ts
index.html
try.js
      if (!cmp(touchDrag, cur)) return;
2906
          if (counter != curCount) return;
2907
          display.scroller.scrollTop += outside;
2908
          extend(e);
2909
        }), 50);
2910
      }
2911
    }
2912
 
2913
    function done(e) {
2914
      counter = Infinity;
2915
      e_preventDefault(e);
2916
      focusInput(cm);
2917
      off(document, "mousemove", move);
2918
      off(document, "mouseup", up);
2919
      doc.history.lastSelOrigin = null;
2920
    }
2921
 
2922
    var move = operation(cm, function(e) {
2923
      if (!e_button(e)) done(e);
2924
      else extend(e);
2925
    });
2926
    var up = operation(cm, done);
2927
    on(document, "mousemove", move);
2928
    on(document, "mouseup", up);
2929
  }
2930
 
2931
  var touchDrag;
2932
  function onTouchMove(e) {
2933
    if (!e.touches || e.touches.length !== 1 || e.touches[0].radiusX>1 || e.touches[0].radiusY>1) return;
2934
    var cm = this;
2935
 
2936
    if (touchDrag) {
2937
      var cur = posFromMouse(cm, e);
2938
      e_preventDefault(e);
2939
      if (!cmp(touchDrag, cur)) return;
2940
      extendSelection(cm.doc, clipPos(cm.doc, touchDrag), cur);
2941
      return;
2942
    }
2943
    
2944
    touchDrag = posFromMouse(cm, e);
2945
    if (!touchDrag) return;
2946
    
2947
    var cm = this;
2948
    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
2949
      return;
2950
    
2951
    function done(e) {
2952
      touchDrag = null;
2953
      e_preventDefault(e);
2954
      focusInput(cm);
2955
      off(document, "touchend", up);
2956
    }
2957
 
2958
    e_preventDefault(e);
2959
    var up = operation(cm, done);
2960
    on(document, "touchend", up);
2961
  }
2962
 
2963
  // Determines whether an event happened in the gutter, and fires the
2964
  // handlers for the corresponding event.
2965
  function gutterEvent(cm, e, type, prevent, signalfn) {
2966
    try { var mX = e.clientX, mY = e.clientY; }
2967
    catch(e) { return false; }
2968
    if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) return false;
2969
    if (prevent) e_preventDefault(e);
2970
 
2971
    var display = cm.display;
2972
    var lineBox = display.lineDiv.getBoundingClientRect();
2973
 
2974
    if (mY > lineBox.bottom || !hasHandler(cm, type)) return e_defaultPrevented(e);
2975
    mY -= lineBox.top - display.viewOffset;
2976
 
2977
    for (var i = 0; i < cm.options.gutters.length; ++i) {
2978
      var g = display.gutters.childNodes[i];
2979
      if (g && g.getBoundingClientRect().right >= mX) {
2980
        var line = lineAtHeight(cm.doc, mY);
2981
        var gutter = cm.options.gutters[i];
2982
        signalfn(cm, type, cm, line, gutter, e);
2983
        return e_defaultPrevented(e);
2984
      }
2985
    }
2986
  }
2987
 
2988
  function clickInGutter(cm, e) {
2989
    return gutterEvent(cm, e, "gutterClick", true, signalLater);
2990
  }
2991
 
2992
  // Kludge to work around strange IE behavior where it'll sometimes
2993
  // re-fire a series of drag-related events right after the drop (#1551)
2994
  var lastDrop = 0;
2995
 
2996
  function onDrop(e) {
2997
    var cm = this;
2998
    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
0:0